﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using ZH.Service.Interface;

namespace ZH.Api.Admin.Controllers.Admin
{
    /// <summary>
    /// 管理端·用户管理
    /// </summary>
    public class MobController : BaseController
    {
        private readonly I_Mobile_Service _mobile_Service;
        public MobController(I_Login_Service login_Service,I_Mobile_Service mobile_Service) : base(login_Service)
        {
            _mobile_Service = mobile_Service;
        }

        /// <summary>
        /// 获取所有的用户
        /// </summary>
        /// <param name="page"></param>
        /// <param name="limit"></param>
        /// <param name="key"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<IActionResult> get_Nmoble(int? page=1,int? limit=10 ,string? key="") {
            var result = await _mobile_Service.get_Nmoble(
                page:page,
                limit: limit,
                key:key
                );
            return Ok(result);
        }


        /// <summary>
        /// 今天新增客户
        /// </summary>
        /// <param name="page"></param>
        /// <param name="limit"></param>
        /// <param name="key"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<IActionResult> Get_Rmoble(int? page = 1, int? limit = 10, string? key = "") {

            var result = await _mobile_Service.Get_Rmoble(
                  page: page,
                limit: limit,
                key: key
                );

            return Ok(result);
        }

    }
}
